<form name="form" ng-init="vm.init();refresh(vm.callback);" ng-submit="vm.evaluate(form.$valid)" novalidate>
  <div class="row x-page-header">
    <div class="col-md-12">
      <div class="x-page-title">POJO 对象推导</div>
      <div class="pull-right">
        <button class="btn btn-primary" ng-disabled="form.$invalid || !vm.parsable || !vm.hasText"
            type="submit">推导</button>
        <div class="btn-group x-btn-list">
          <button id="copy" class="btn btn-success" type="button" ng-disabled="vm.code == ''">复制</button>
          <button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown"
              ng-disabled="vm.code == ''">
            <span class="caret"></span>
          </button>
          <ul class="dropdown-menu dropdown-menu-right">
            <li><button type="button" class="btn btn-default btn-block" ng-click="vm.save()">保存文件</button></li>
          </ul>
        </div>
        <button class="btn btn-danger" type="button" ng-click="vm.reset()">重置</button>
      </div>
    </div>
  </div>
  <div class="row x-page-body">
    <div class="col-md-7">
      <fieldset>
        <legend>推导条件<font color="green">（根据文本内容推导出POJO）</font></legend>
        <div class="x-page-scope">
          <div class="x-evalcheck">
            <div class="form-group">
              <div class="input-group">
                <input type="text" name="pojo" class="form-control" placeholder="包名.类名（package.class）" autofocus
                    ng-model="vm.pojo" required ng-class="{'x-invalid': form.$submitted && form.pojo.$invalid}">
                <span class="input-group-addon">.java</span>
              </div>
            </div>
            <div class="form-group">
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.primitive">使用基本类型
              </label>
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.gettersAndSetters">包含Getters和Setters
              </label>
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.constructor">包含构造器
              </label>
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.hashCodeAndEquals">包含hashCode和equals
              </label>
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.toString">包含toString
              </label>
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.serializable">标记为Serializable
              </label>
            </div>
            <div class="form-group">
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.builder">使用Builder方式
              </label>
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.commentAndAnnotation">注释和注解
              </label>
              <label class="checkbox-inline">
                <input type="checkbox" ng-model="vm.config.lombok.checked">使用Lombok注解
              </label>
              <div class="checkbox-inline x-checkbox-list" style="margin-left:0" ng-show="vm.config.lombok.checked">
                <a href="javascript:void(0)" data-toggle="dropdown">Lombok<span class="caret"></span></a>
                <ul class="dropdown-menu" ng-click="$event.stopPropagation()">
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.data">Data</label>
                  </li>
                  <li class="divider"></li>
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.getter">Getter</label>
                  </li>
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.setter">Setter</label>
                  </li>
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.toString">ToString</label>
                  </li>
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.equalsAndHashCode">EqualsAndHashCode</label>
                  </li>
                  <li class="divider"></li>
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.noArgsConstructor">NoArgsConstructor</label>
                  </li>
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.requiredArgsConstructor">RequiredArgsConstructor</label>
                  </li>
                  <li class="checkbox">
                    <label><input type="checkbox" ng-model="vm.config.lombok.allArgsConstructor">AllArgsConstructor</label>
                  </li>
                </ul>
              </div>
            </div>
            <div class="form-group">
              <label class="control-label">文本类型：</label>
              <label class="radio-inline">
                <input type="radio" name="textType" value="json" ng-model="vm.config.textType">JSON
              </label>
              <label class="radio-inline">
                <input type="radio" name="textType" value="xml" ng-model="vm.config.textType">XML
              </label>
              <label class="radio-inline">
                <input type="radio" name="textType" value="sql" ng-model="vm.config.textType">SQL
              </label>
              <font color="green">（值类型标识符：{type:Object}）</font>
            </div>
          </div>
          <div class="x-evaltext">
            <div class="x-editor">
              <pre id="text-editor"></pre>
            </div>
          </div>
        </div>
      </fieldset>
    </div>
    <div class="col-md-5">
      <fieldset>
        <legend>推导结果</legend>
        <div class="x-page-scope">
          <div class="x-editor">
            <pre class="x-output" id="java-viewer"></pre>
          </div>
        </div>
      </fieldset>
    </div>
  </div>
</form>
